package com.neusoft.demo.mapper;

import com.neusoft.demo.pojo.Bumen;
import com.neusoft.demo.pojo.Yuangong;
import org.apache.ibatis.annotations.*;

@Mapper
public interface BumenMapper {
    @Select("select * from bumen order by id desc")
    public java.util.List<Bumen> bumenList();
    @Update("update bumen set bname=#{bname},badress=#{badress} where id=#{id} ")
    public  int updateBumen(Bumen bumen);
    @Delete("delete from bumen where id=#{id}")
    public  int delBumen(int yid);
    @Insert("insert into bumen(bname,badress) values(#{bname},#{badress})")
    public  int addBumen(Bumen bumen);
    @Select("<script> select * from bumen <where>" +
            "<if test=\"bname!=null and bname!=''\"> bname like concat('%',#{bname},'%')</if>" +
            "<if test=\"badress!=null and badress!='' \"> badress like concat('%',#{badress},'%')</if>" +
            "</where> </script>")
    public java.util.List<Bumen> bumenSearch(String bname,String badress);


}
